package com.ruoyi.receipt.context;

import com.ruoyi.receipt.domain.TbUser;

public class UserContextHolder {
    private final static ThreadLocal<TbUser> threadLocal = new ThreadLocal<>();

    public static TbUser getUser() {
        return threadLocal.get();
    }

    public static void setUser(TbUser tbUser) {
        threadLocal.set(tbUser);
    }

    public static void clearUser() {
        threadLocal.remove();
    }
}